# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=rdma-core
pkgver=49.0
pkgrel=0
pkgdesc="RDMA core userspace libraries and daemons"
url="https://github.com/linux-rdma/rdma-core"
license="GPL-2.0-only OR BSD-2-Clause"
arch="all !s390x !riscv64" # rv64 textrels, s390x ftbfs
options="!check" # tests are for installation
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="
	cmake
	eudev-dev
	libdrm-dev
	libnl3-dev
	py3-docutils
	samurai
	"
subpackages="$pkgname-libs $pkgname-dev $pkgname-doc $pkgname-openrc"
source="https://github.com/linux-rdma/rdma-core/releases/download/v$pkgver/rdma-core-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
88537ea872e32834585d631458062bb96741147b4a58d1f263b8661b5a2206810bdb0fcf194effae4323a56116248fd6d0967767d68402f6ee06863b05a29571  rdma-core-49.0.tar.gz
"
